import request from '@/utils/request';

const api = {
	LIST: '/shop/product_list',
	DETAIL: '/shop/product_detail',
	SKU: '/shop/product_sku',
	SKU_STORE_NUM: '/shop/product_sku_store_num',
	COMMENT_LIST: '/shop/product_comment_list'
}

export async function productList(params) {
	return request.get(api.LIST, params);
}

export async function productDetail(id) {
	let params = {id: id};
	return request.get(api.DETAIL, params);
}

export async function productSku(productId, indexes) {
	let params = {
		productId: productId,
		indexes: indexes
	};
	return request.get(api.DETAIL, params);
}

export async function productSkuStoreNum(id) {
	let params = {
		id: id
	};
	return request.get(api.SKU_STORE_NUM, params);
}

export async function productCommentList(productId) {
	let params = {
		productId: productId
	};
	return request.get(api.COMMENT_LIST, params);
}

